package com.gyg.client;

import com.gyg.returns.RespEntity;
import com.gyg.vo.param.DownloadParam;
import com.gyg.vo.param.FileParam;
import com.gyg.vo.param.UpdateFileParam;
import com.gyg.vo.result.FileDownloadResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "cloudVideoClient", url = "${cloud.box.url}")
public interface CloudVideoClient {

    /**
     * 视频数据上传
     * @param fileParam
     * @return
     */
    @PostMapping("/cloud-video/upload")
    RespEntity uploadVideo(@RequestBody FileParam fileParam);

    /**
     * 视频列表数据
     * @param userId
     * @param pageNum
     * @param pageSize
     * @param content
     * @return
     */
    @GetMapping("/cloud-video/list")
    RespEntity cloudVideoList(@RequestParam(value = "userId", required = true) Integer userId,
                              @RequestParam(value = "pageNum", required = true) Integer pageNum,
                              @RequestParam(value = "pageSize", required = true) Integer pageSize,
                              @RequestParam(value = "content", required = false) String content);

    /**
     * 编辑视频
     * @param updateFileParam
     * @return
     */
    @PutMapping("/cloud-video/update")
    RespEntity updateVideo(@RequestBody UpdateFileParam updateFileParam);

    /**
     * 删除视频
     * @param videoId
     * @return
     */
    @DeleteMapping("/cloud-video/delete")
    RespEntity deleteVideo(@RequestParam(value = "videoId", required = true) Integer videoId);

    /**
     * 视频云盘信息
     * @param userId
     * @return
     */
    @GetMapping("/cloud-video/info")
    RespEntity videoCloudInfo(@RequestParam(value = "userId", required = true) Integer userId);

    /**
     * 视频下载
     * @param downloadParam
     * @return
     */
    @PostMapping("/cloud-video/download")
    RespEntity<FileDownloadResult> download(@RequestBody DownloadParam downloadParam);
}
